home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Magazine / PC2Amiga / Samba / docs / textdocs / UNIX_INSTALL.txt < prev    next >
Text File  |  2000-04-25  |  13KB  |  336 lines

  1. !==
  2. !== UNIX_INSTALL.txt for Samba release 2.0.7 26 Apr 2000
  3. !==
  4. HOW TO INSTALL AND TEST SAMBA
  5. =============================
  6.  
  7. STEP 0. Read the man pages. They contain lots of useful info that will
  8. help to get you started. If you don't know how to read man pages then
  9. try something like:
  10.  
  11.     nroff -man smbd.8 | more
  12.  
  13. Other sources of information are pointed to by the Samba web 
  14. site, http://samba.org/samba.
  15.  
  16. STEP 1. Building the binaries
  17.  
  18. To do this, first run the program ./configure in the source
  19. directory. This should automatically configure Samba for your
  20. operating system. If you have unusual needs then you may wish to run
  21. "./configure --help" first to see what special options you can enable.
  22.  
  23. Then type "make". This will create the binaries.
  24.  
  25. Once it's successfully compiled you can use "make install" to install
  26. the binaries and manual pages. You can separately install the binaries
  27. and/or man pages using "make installbin" and "make installman".
  28.  
  29. Note that if you are upgrading for a previous version of Samba you
  30. might like to know that the old versions of the binaries will be
  31. renamed with a ".old" extension. You can go back to the previous
  32. version with "make revert" if you find this version a disaster!
  33.  
  34. STEP 2. The all important step
  35.  
  36. At this stage you must fetch yourself a coffee or other drink you find
  37. stimulating. Getting the rest of the install right can sometimes be
  38. tricky, so you will probably need it.
  39.  
  40. If you have installed samba before then you can skip this step. 
  41.  
  42. STEP 3. Create the smb configuration file. 
  43.  
  44. There are sample configuration files in the examples subdirectory in
  45. the distribution. I suggest you read them carefully so you can see how
  46. the options go together in practice. See the man page for all the
  47. options.
  48.  
  49. The simplest useful configuration file would be something like this:
  50.  
  51.    workgroup = MYGROUP
  52.  
  53.    [homes]
  54.       guest ok = no
  55.       read only = no
  56.  
  57. which would allow connections by anyone with an account on the server,
  58. using either their login name or "homes" as the service name. (Note
  59. that I also set the workgroup that Samba is part of. See BROWSING.txt
  60. for defails)
  61.  
  62. Note that "make install" will not install a smb.conf file. You need to
  63. create it yourself. You will also need to create the path you specify
  64. in the Makefile for the logs etc, such as /usr/local/samba.
  65.  
  66. Make sure you put the smb.conf file in the same place you specified in
  67. the Makefile.
  68.  
  69. For more information about security settings for the [homes] share please
  70. refer to the document UNIX_SECURITY.txt
  71.  
  72. STEP 4. Test your config file with testparm
  73.  
  74. It's important that you test the validity of your smb.conf file using
  75. the testparm program. If testparm runs OK then it will list the loaded
  76. services. If not it will give an error message.
  77.  
  78. Make sure it runs OK and that the services look resonable before
  79. proceeding. 
  80.  
  81. STEP 5. Starting the smbd and nmbd. 
  82.  
  83. You must choose to start smbd and nmbd either as daemons or from
  84. inetd. Don't try to do both!  Either you can put them in inetd.conf
  85. and have them started on demand by inetd, or you can start them as
  86. daemons either from the command line or in /etc/rc.local. See the man
  87. pages for details on the command line options. Take particular care 
  88. to read the bit about what user you need to be in order to start Samba.
  89. In many cases you must be root.
  90.  
  91. The main advantage of starting smbd and nmbd as a daemon is that they
  92. will respond slightly more quickly to an initial connection
  93. request. This is, however, unlilkely to be a problem.
  94.  
  95. Step 5a. Starting from inetd.conf
  96.  
  97. NOTE; The following will be different if you use NIS or NIS+ to
  98. distributed services maps.
  99.  
  100. Look at your /etc/services. What is defined at port 139/tcp. If
  101. nothing is defined then add a line like this:
  102.  
  103. netbios-ssn     139/tcp
  104.  
  105. similarly for 137/udp you should have an entry like:
  106.  
  107. netbios-ns    137/udp
  108.  
  109. Next edit your /etc/inetd.conf and add two lines something like this:
  110.  
  111. netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd 
  112. netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd 
  113.  
  114. The exact syntax of /etc/inetd.conf varies between unixes. Look at the
  115. other entries in inetd.conf for a guide.
  116.  
  117. NOTE: Some unixes already have entries like netbios_ns (note the
  118. underscore) in /etc/services. You must either edit /etc/services or
  119. /etc/inetd.conf to make them consistant.
  120.  
  121. NOTE: On many systems you may need to use the "interfaces" option in
  122. smb.conf to specify the IP address and netmask of your interfaces. Run
  123. ifconfig as root if you don't know what the broadcast is for your
  124. net. nmbd tries to determine it at run time, but fails on some
  125. unixes. See the section on "testing nmbd" for a method of finding if
  126. you need to do this.
  127.  
  128. !!!WARNING!!! Many unixes only accept around 5 parameters on the
  129. command line in inetd. This means you shouldn't use spaces between the
  130. options and arguments, or you should use a script, and start the
  131. script from inetd.
  132.  
  133. Restart inetd, perhaps just send it a HUP. If you have installed an
  134. earlier version of nmbd then you may need to kill nmbd as well.
  135.  
  136. Step 5b. Alternative: starting it as a daemon
  137.  
  138. To start the server as a daemon you should create a script something
  139. like this one, perhaps calling it "startsmb"
  140.  
  141. #!/bin/sh
  142. /usr/local/samba/bin/smbd -D 
  143. /usr/local/samba/bin/nmbd -D 
  144.  
  145. then make it executable with "chmod +x startsmb"
  146.  
  147. You can then run startsmb by hand or execute it from /etc/rc.local
  148.  
  149. To kill it send a kill signal to the processes nmbd and smbd.
  150.  
  151. NOTE: If you use the SVR4 style init system then you may like to look
  152. at the examples/svr4-startup script to make Samba fit into that system.
  153.  
  154.  
  155. STEP 6. Try listing the shares available on your server
  156.  
  157. smbclient -L yourhostname 
  158.  
  159. Your should get back a list of shares available on your server. If you
  160. don't then something is incorrectly setup. Note that this method can
  161. also be used to see what shares are available on other LanManager
  162. clients (such as WfWg).
  163.  
  164. If you choose user level security then you may find that Samba requests
  165. a password before it will list the shares. See the smbclient docs for
  166. details. (you can force it to list the shares without a password by
  167. adding the option -U% to the command line. This will not work with
  168. non-Samba servers)
  169.  
  170. STEP 7. try connecting with the unix client. eg:
  171.  
  172. smbclient //yourhostname/aservice
  173.  
  174. Typically the "yourhostname" would be the name of the host where you
  175. installed smbd. The "aservice" is any service you have defined in the
  176. smb.conf file. Try your user name if you just have a [homes] section
  177. in smb.conf.
  178.  
  179. For example if your unix host is bambi and your login name is fred you
  180. would type:
  181.  
  182. smbclient //bambi/fred
  183.  
  184. STEP 8. Try connecting from a dos/WfWg/Win95/NT/os-2 client. Try
  185. mounting disks. eg:
  186.  
  187. net use d: \\servername\service
  188.  
  189. Try printing. eg:
  190.  
  191. net use lpt1: \\servername\spoolservice
  192. print filename
  193.  
  194. Celebrate, or send me a bug report!
  195.  
  196. WHAT IF IT DOESN'T WORK?
  197. ========================
  198.  
  199. If nothing works and you start to think "who wrote this pile of trash"
  200. then I suggest you do step 2 again (and again) till you calm down.
  201.  
  202. Then you might read the file DIAGNOSIS.txt and the FAQ. If you are
  203. still stuck then try the mailing list or newsgroup (look in the README
  204. for details). Samba has been successfully installed at thousands of
  205. sites worldwide, so maybe someone else has hit your problem and has
  206. overcome it. You could also use the WWW site to scan back issues of
  207. the samba-digest.
  208.  
  209. When you fix the problem PLEASE send me some updates to the
  210. documentation (or source code) so that the next person will find it
  211. easier. 
  212.  
  213. DIAGNOSING PROBLEMS
  214. ===================
  215.  
  216. If you have instalation problems then go to DIAGNOSIS.txt to try to
  217. find the problem.
  218.  
  219. SCOPE IDs
  220. =========
  221.  
  222. By default Samba uses a blank scope ID. This means all your windows
  223. boxes must also have a blank scope ID. If you really want to use a
  224. non-blank scope ID then you will need to use the -i <scope> option to
  225. nmbd, smbd, and smbclient. All your PCs will need to have the same
  226. setting for this to work. I do not recommend scope IDs.
  227.  
  228.  
  229. CHOOSING THE PROTOCOL LEVEL
  230. ===========================
  231.  
  232. The SMB protocol has many dialects. Currently Samba supports 5, called
  233. CORE, COREPLUS, LANMAN1, LANMAN2 and NT1.
  234.  
  235. You can choose what maximum protocol to support in the smb.conf
  236. file. The default is NT1 and that is the best for the vast majority of
  237. sites.
  238.  
  239. In older versions of Samba you may have found it necessary to use
  240. COREPLUS. The limitations that led to this have mostly been fixed. It
  241. is now less likely that you will want to use less than LANMAN1. The
  242. only remaining advantage of COREPLUS is that for some obscure reason
  243. WfWg preserves the case of passwords in this protocol, whereas under
  244. LANMAN1, LANMAN2 or NT1 it uppercases all passwords before sending them,
  245. forcing you to use the "password level=" option in some cases.
  246.  
  247. The main advantage of LANMAN2 and NT1 is support for long filenames with some
  248. clients (eg: smbclient, Windows NT or Win95). 
  249.  
  250. See the smb.conf manual page for more details.
  251.  
  252. Note: To support print queue reporting you may find that you have to
  253. use TCP/IP as the default protocol under WfWg. For some reason if you
  254. leave Netbeui as the default it may break the print queue reporting on
  255. some systems. It is presumably a WfWg bug.
  256.  
  257.  
  258. PRINTING FROM UNIX TO A CLIENT PC
  259. =================================
  260.  
  261. To use a printer that is available via a smb-based server from a unix
  262. host you will need to compile the smbclient program. You then need to
  263. install the script "smbprint". Read the instruction in smbprint for
  264. more details.
  265.  
  266. There is also a SYSV style script that does much the same thing called
  267. smbprint.sysv. It contains instructions.
  268.  
  269.  
  270. LOCKING
  271. =======
  272.  
  273. One area which sometimes causes trouble is locking.
  274.  
  275. There are two types of locking which need to be performed by a SMB
  276. server. The first is "record locking" which allows a client to lock a
  277. range of bytes in a open file. The second is the "deny modes" that are
  278. specified when a file is open.
  279.  
  280. Samba supports "record locking" using the fcntl() unix system
  281. call. This is often implemented using rpc calls to a rpc.lockd process
  282. running on the system that owns the filesystem. Unfortunately many
  283. rpc.lockd implementations are very buggy, particularly when made to
  284. talk to versions from other vendors. It is not uncommon for the
  285. rpc.lockd to crash.
  286.  
  287. There is also a problem translating the 32 bit lock requests generated
  288. by PC clients to 31 bit requests supported by most
  289. unixes. Unfortunately many PC applications (typically OLE2
  290. applications) use byte ranges with the top bit set as semaphore
  291. sets. Samba attempts translation to support these types of
  292. applications, and the translation has proved to be quite successful.
  293.  
  294. Strictly a SMB server should check for locks before every read and
  295. write call on a file. Unfortunately with the way fcntl() works this
  296. can be slow and may overstress the rpc.lockd. It is also almost always
  297. unnecessary as clients are supposed to independently make locking
  298. calls before reads and writes anyway if locking is important to
  299. them. By default Samba only makes locking calls when explicitly asked
  300. to by a client, but if you set "strict locking = yes" then it will
  301. make lock checking calls on every read and write. 
  302.  
  303. You can also disable by range locking completely using "locking =
  304. no". This is useful for those shares that don't support locking or
  305. don't need it (such as cdroms). In this case Samba fakes the return
  306. codes of locking calls to tell clients that everything is OK.
  307.  
  308. The second class of locking is the "deny modes". These are set by an
  309. application when it opens a file to determine what types of access
  310. should be allowed simultaneously with its open. A client may ask for
  311. DENY_NONE, DENY_READ, DENY_WRITE or DENY_ALL. There are also special
  312. compatability modes called DENY_FCB and DENY_DOS.
  313.  
  314. You can disable share modes using "share modes = no". This may be
  315. useful on a heavily loaded server as the share modes code is very
  316. slow. See also the FAST_SHARE_MODES option in the Makefile for a way
  317. to do full share modes very fast using shared memory (if your OS
  318. supports it).
  319.  
  320.  
  321. MAPPING USERNAMES
  322. =================
  323.  
  324. If you have different usernames on the PCs and the unix server then
  325. take a look at the "username map" option. See the smb.conf man page
  326. for details.
  327.  
  328.  
  329. OTHER CHARACTER SETS
  330. ====================
  331.  
  332. If you have problems using filenames with accented characters in them
  333. (like the German, French or Scandinavian character sets) then I
  334. recommmend you look at the "valid chars" option in smb.conf and also
  335. take a look at the validchars package in the examples directory.
  336.